<template>
  <div class="table">
    <div class="table-list">
      <div v-for="(item, index) in props.tableData" :key="index">
        <div class="table-item">
          <div class="row licensePlate" style="justify-content: center">
            <div>{{ item.licensePlate }}</div>
            <div>
              （{{
                item.cardType == 1
                  ? "临时卡"
                  : item.cardType == 2
                  ? "月卡"
                  : item.cardType == 3
                  ? "白名单"
                  : "-"
              }}）
            </div>
          </div>
          <!-- 放大图片 -->
          <!-- <el-image
            :src="'http://cippfile.ecaray.com/' + item.inImage"
            class="icon-inImage"
            :zoom-rate="1.2"
            :max-scale="7"
            :min-scale="0.2"
            :preview-src-list="['http://cippfile.ecaray.com/' + item.inImage]"
            :initial-index="0"
            fit="cover"
            title="场内照片"
          /> -->
          <el-image
            @click="getCard(item)"
            :src="'http://cippfile.ecaray.com/' + item.inImage"
            class="icon-inImage"
            fit="cover"
            title="场内照片"
          />
          <div class="contents">
            <div class="content">
              <div class="lotName">{{ item.lotName }}</div>
              <div class="duration">
                <span style="color: #666666">已停放</span>{{ item.duration }}
              </div>
            </div>
            <div class="inTime">{{ item.inTime }}入场</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { reactive, ref, defineProps } from "vue";
const emits = defineEmits(["table"]);

const props = defineProps({
  tableData: {
    type: Object,
    default: () => {},
  },
  loading: {
    type: Boolean,
    default: false,
  },
});

// 点击获取卡片信息
const getCard = (row) => {
  row.operation = 1;
  emits("table", row);
};
</script>
<style lang="less" scoped>
.table {
  margin-bottom: 15px;
}
.table-list {
  display: flex;
  flex-wrap: wrap;
  //   justify-content: space-between;
}
.table-list > div {
  margin-right: 16px;
  margin-bottom: 16px;
}
.table-item {
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #e5e8ef;
  // cursor: pointer;
  //   flex: 0 0 25%;
  //   box-sizing: border-box;
  //   padding: 10px;
}
.licensePlate {
  font-weight: 600;
  font-size: 16px;
  color: #000000;
  margin: 8px 0;
}
.icon-inImage {
  width: 275px;
  height: 150px;
  cursor: pointer;
}
.row {
  display: flex;
  align-items: center;
}
.contents {
  padding: 12px 12px 10px;
}
.content {
  display: flex;
  justify-content: space-between;
}
.lotName {
  font-weight: 600;
  font-size: 12px;
  color: #000000;
}
.duration {
  font-weight: 400;
  font-size: 12px;
  color: #007aff;
}
.inTime {
  margin-top: 6px;
  font-weight: 400;
  font-size: 12px;
  color: #666666;
}
</style>
